#region File Description
//-----------------------------------------------------------------------------
// OptionsMenuScreen.cs
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#endregion

#region Using Statements
using System;
using Microsoft.Xna.Framework;
#endregion

namespace GameStateManagement
{
    /// <summary>
    /// The options screen is brought up over the top of the main menu
    /// screen, and gives the user a chance to configure the game
    /// in various hopefully useful ways.
    /// </summary>
    class OptionsMenuScreen : MenuScreen
    {
        #region Fields

    
        MenuEntry instructionMenuEntry;

       

        static string[] Instructions = { "Space Race is easy to play!", "Use W to accelerate, S to deccelerate" + '\n' + "          and the mouse to steer", "The stars around the planet are collapsing", "Follow the arrow to pick up checkpoints", "Checkpoints will push the stars " + '\n' + "             away from the planet", "If the stars collapse " + '\n' + "              on the planet, it's game over", "Don't forget to keep your eye out" + '\n' + "          for powerups, wormholes and enemies!" };
        static int currentInstruction = 0;

       

        #endregion

        #region Initialization


        /// <summary>
        /// Constructor.
        /// </summary>
        public OptionsMenuScreen()
            : base("Options")
        {
            // Create our menu entries.
            instructionMenuEntry = new MenuEntry(string.Empty);

            SetMenuEntryText();

            MenuEntry backMenuEntry = new MenuEntry("Back");

            // Hook up menu event handlers.
            instructionMenuEntry.Selected += InstructionMenuEntrySelected;
            backMenuEntry.Selected += OnCancel;
            
            // Add entries to the menu.
            MenuEntries.Add(instructionMenuEntry);
            MenuEntries.Add(backMenuEntry);
        }


        /// <summary>
        /// Fills in the latest values for the options screen menu text.
        /// </summary>
        void SetMenuEntryText()
        {
          
            instructionMenuEntry.Text = "Instructions: " + Instructions[currentInstruction];
        }


        #endregion

        #region Handle Input


     

        /// <summary>
        /// Event handler for when the Language menu entry is selected.
        /// </summary>
        void InstructionMenuEntrySelected(object sender, EventArgs e)
        {
            currentInstruction = (currentInstruction + 1) % Instructions.Length;

            SetMenuEntryText();
        }


    

        #endregion
    }
}
